package com.jp.fm.data;

import java.util.Date;

import org.apache.commons.lang3.builder.ToStringBuilder;

public class Budget implements Comparable<Budget> {

	private Integer id = null;
	private Date date = null;
	private Float amount = null;
	private String repeatInterval = null;
	private String type = null;
	private Category category = null;
	private Float currentAmount = null;

	public Budget(final Integer id, final Date date, final Float amount,
			final String repeatInterval, final String type,
			final Category category) {
		super();
		this.id = id;
		this.date = date;
		this.amount = amount;
		this.repeatInterval = repeatInterval;
		this.type = type;
		this.category = category;
	}

	public final Integer getId() {
		return this.id;
	}

	public final void setId(final Integer id) {
		this.id = id;
	}

	public final Date getDate() {
		return this.date;
	}

	public final void setDate(final Date date) {
		this.date = date;
	}

	public final Float getAmount() {
		return this.amount;
	}

	public final void setAmount(final Float amount) {
		this.amount = amount;
	}

	public final String getRepeatInterval() {
		return this.repeatInterval;
	}

	public final void setRepeatInterval(final String repeatInterval) {
		this.repeatInterval = repeatInterval;
	}

	public final String getType() {
		return this.type;
	}

	public final void setType(final String type) {
		this.type = type;
	}

	public final Category getCategory() {
		return this.category;
	}

	public final void setCategory(final Category category) {
		this.category = category;
	}

	public final Float getCurrentAmount() {
		return this.currentAmount;
	}

	public final void setCurrentAmount(final Float currentAmount) {
		this.currentAmount = currentAmount;
	}

	@Override
	public final String toString() {
		return ToStringBuilder.reflectionToString(this);
	}

	@Override
	public final int compareTo(final Budget o) {

		return this.getCategory().getName()
				.compareTo(o.getCategory().getName());
	}
}
